package com.system.healthproject.mapper;

import com.system.healthproject.bean.web.ResultCard;
import com.system.healthproject.bean.web.ResultPatientAccount;
import com.system.healthproject.bean.web.ResultSickuserAccountDetailed;
import com.system.healthproject.model.admin.paramsbean.PatientDoctor;
import com.system.healthproject.model.admin.paramsbean.PatientInfo;
import com.system.healthproject.model.admin.paramsbean.PatientParems;
import com.system.healthproject.model.admin.paramsbean.ProvinceParams;
import com.system.healthproject.model.doctor.params.FollowPatientParams;
import com.system.healthproject.model.sickuser.params.UserPatientInfo;
import com.system.healthproject.pojo.Banner;
import com.system.healthproject.pojo.Patient;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface PatientMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Integer patientId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    int insert(Patient record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    int insertSelective(Patient record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    Patient selectByPrimaryKey(Integer patientId);

    Patient selectByLoginId(Integer loginId);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(Patient record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table patient
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(Patient record);

    List<PatientParems> getListPatient(@Param("page") Integer page, @Param("size") Integer size,
                                       @Param("name") String name,
                                       @Param("sex") Integer sex,
                                       @Param("city") Integer city,
                                       @Param("hasRecord") Integer hasRecord,
                                       @Param("diagnosis_time") String diagnosis_time,
                                       @Param("doctorId")Integer doctorId);

    int getListPatientCount(@Param("page")Integer page,
                            @Param("size")Integer size,
                            @Param("name")String name,
                            @Param("sex")Integer sex,
                            @Param("city")Integer city,
                            @Param("hasRecord")Integer hasRecord,
                            @Param("diagnosis_time")String diagnosis_time,
                            @Param("doctorId")Integer doctorId);

    int changUserDoctors(PatientDoctor patientDoctor);

    int getPatientId(Integer patientId);

    int getPatientTotal();

    int getPatientTotalByDoctorId(Integer doctorId);

    int getPatientTotalByCode(Integer provinceCode);

    int getPatientTotalByCodeAndDoctorId(
            @Param("doctorId")      Integer doctorId,
            @Param("provinceCode")  Integer provinceCode);


    int getNowWeekTotal();

    int getNowWeekTotalByDoctorId(Integer integer);

    int getNowWeekTotalByCode(Integer provinceCode);

    int getNowWeekTotalByCodeAndDoctorId(
            @Param("doctorId")      Integer doctorId,
            @Param("provinceCode")  Integer provinceCode);

    List<ProvinceParams> getIsPatientByProvince();


    PatientInfo patientInfoByLoginId(Integer patientId);

    UserPatientInfo getPatientInfoByLoginId(Integer loginId);

    ResultPatientAccount selectSickuserAccount(Integer loginId);

    List<ResultSickuserAccountDetailed> selectSickuserAccountDetailed(Integer loginId);

    int getFollowTotalByDoctorId(Integer integer);

    int getFollowTotalByDoctorIdAndCode(
            @Param("doctorId") Integer doctorId,
            @Param("provinceCode") Integer provinceCode);


    int getNowWeekFollowTotalByDoctorId(Integer integer);

    int getNowWeekFollowTotalByDoctorIdAndCode(
            @Param("doctorId")      Integer doctorId,
            @Param("provinceCode")  Integer provinceCode);

    List<FollowPatientParams> doctorGetFollowList(
            @Param("page") Integer page,
            @Param("size") Integer size,
            @Param("doctorId") Integer doctorId);

    int doctorGetFollowTotal(
            @Param("page") Integer page,
            @Param("size") Integer size,
            @Param("doctorId") Integer doctorId);

    /**
     * 根据登陆ID查询患者ID
     * @param loginId
     * @return
     */
    Integer selectPatientId(Integer loginId);


}
